const {BrowserWindow} = require("electron");
const path = require("path");
let win
const createControlWindow = function () {
    win = new BrowserWindow({
        width: 1200,
        height: 1000,
        webPreferences: {
            nodeIntegration: true
        }
    })

    let url = require('url').format({
        protocol: 'file',
        slashes: true,
        pathname: path.resolve(__dirname, '../../renderer/pages/control/index.html')
    })

    const res = win.loadURL(url);

    // win.webContents.openDevTools()
}


function send(channel, ...args) {
    win.webContents.send(channel, ...args);
}

module.exports = {createControlWindow, send}
